/*
		n^2 + n + x = m^2
		(2n+1)^2 - (2m)^2 = 1 - 4x
		令p = 2n+1, q = 2m, C = 1-4x
		p^2 - q^2 = C
		(p+q)*(p-q) = C
		枚举D的因子,满足 A*B = C
		有 A = p+q, B = p-q
		2*p = A + B
		4n+2 = A+B
		n = (A+B-2)/4
*/

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
int main() {
	ll x;
	cin >> x;
	ll C = 1 - 4*x;
	set<ll>ans;
    for (ll i = 1; i * i <= abs(C); i++) {
        if (C % i == 0) {
            vector<ll> divs = {i, -i, C / i, -C / i};
            for (auto A : divs) {
                ll B = C / A;
                if ((A + B - 2) % 4 == 0) {
                    ll n = (A + B - 2) / 4;
                    ans.insert(n);
                }
            }
        }
    }
    cout << ans.size() << endl;
    for (ll n : ans) {
        cout << n << " ";
    }
    cout << endl;

    return 0;
}